package powtorka.watki;

public class DwaWatki implements Runnable {

	@Override
	public void run() {
		for (int i = 0; i < 25; i++)
			System.out.println(Thread.currentThread().getName());
	}

	public static void main(String[] args) throws InterruptedException {
		Thread t1 = new Thread(new DwaWatki());
		t1.setName("pierwszy");
		Thread t2 = new Thread(new DwaWatki());
		t2.setName("drugi");
		Thread.sleep(2000);
		Thread.sleep(1000);
		Thread.currentThread().getName();
		t1.start();
		t2.start();
	}

}
